<?php
$_doc = array();
$_doc['title'] = L('tab_content_edit');
$_doc['extra'] = '<link rel="stylesheet" type="text/css" href="'.__CURRENT__.'/common-use.css" />';
?>
<include file="pAdmin:header" />
    <div id="galleryContainer">
        <div id="gallery"></div>
        <div id="gallery_button">
            <div onclick="setThumb()">{%action_ok}</div>
        </div>
    </div>
<table class="tabmenu" cellspacing="0">
    <tbody>
        <tr>
            <td class="wedge">&nbsp;</td>
            <td class="wmenu"><a href="__URL__/index"><span>{%tab_content_list}</span></a></td>
            <td class="wmenu"><a href="__URL__/add"><span>{%tab_content_add}</span></a></td>
            <td class="wmenu here"><span>{%tab_content_edit}</span></td>
            <td>&nbsp;</td>
        </tr>
    </tbody>
</table>
<script type="text/javascript" src="__TMPL__/my97/WdatePicker.js"></script>
<script type="text/javascript" src="__TMPL__/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="<?php echo __CURRENT__;?>/common-use.js"></script>
<div class="main">
    <ul class="fnc">
        <li><button type="button" class="btn primary" onclick="save()">{%action_publish}</button></li>
        <li><button type="button" class="btn" onclick="preview()">{%action_preview}</button></li>
    </ul>
    <form name="mainForm" action="__URL__" method="post">
        <input type="hidden" name="a" value="update" />
        <input type="hidden" name="status" />
        <input type="hidden" name="id" value="{$post['id']}" />
        <table class="ips">
            <tbody>
                <tr>
                    <th class="essential"><label for="pk1">{%column_title}</label></th>
                    <td>
                        <input id="pk1" type="text" name="title" style="font-size:16px;letter-spacing:1px;font-weight:bold;width:630px;height:60px;" maxlength="240" value="{$post['title']}"/>
                    </td>
                </tr>
               <tr>
                   <th class="essential"><label for="pk3">{%column_created}</label></th>
                   <td>
                       <?php $now=date("Y-m-d H:i:s"); ?>
                       <input id="pk3" type="text" name="created" maxlength="250" size="25" value="{$post['created']}" onfocus="this.blur()"/>
                       <img onclick="WdatePicker({el:'pk3',dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'%y-%M-%d'})" src="__TMPL__/my97/skin/datePicker.gif" width="16" height="22" align="absmiddle"/>
                   </td>
               </tr>
               <tr>
                   <th class="essential"><label>{%column_category}</label></th>
                   <td>
                       <div id="pk_category">
                           <div id="pk_category_inner">
                           <if condition="$popedomCategories eq 'all'">
                               <iterate name="allocateCategories" id="vo">
                               <div style="padding-left:<?php echo 24*intval($vo['ply']-2)?>px;">
                                   <input id="cat{$vo['id']}" type="checkbox" name="category[]" value="{$vo['id']}">
                                   <label for="cat{$vo['id']}">{$vo['name']}</label>
                               </div>
                               </iterate>
                           <else/>
                           <!-- TODO 非全部授权的栏目显示方案 -->
                           
                           </if>
                           </div>
                       </div>
                   </td>
               </tr>
               <tr>
                    <th>&nbsp;</th>
                    <td><ul id="pk_checked_category" class="spana"></ul></td>
               </tr>
           </tbody>
        </table>
        <table style="width:100%;margin:4px 0;">
             <tbody>
                 <tr>
                     <td style="padding:0 60px;">
                         <textarea id="editor" name="content">{$post['content']}</textarea>
                         <script type="text/javascript">
                             editor = CKEDITOR.replace( 'editor', {
                                 height:360,
                                 filebrowserImageUploadUrl:'__APP__/pUpload/ckImgUpload',
                                 contentsCss:'__TMPL__editor.css'
                             });
                         </script>
                     </td>
                 </tr>
             </tbody>
         </table>
         <table class="ips">
            <tbody>
                <tr>
                    <th><label for="type-tag">{%column_tags}</label></th>
                    <td>
                        <div>
                            <input type="text" id="type-tag" size="36"/>
                            <input id="tag-list-hidden" type="hidden" name="tags" />
                            <button type="button" class="btn" id="addTagBtn">{%action_add_tag}</button>
                            <!--<button type="button" class="btn" onclick="selectTag()">{%action_select_tag}</button>-->
                            <p class="hint">{%column_tags_addtip}&nbsp;&nbsp;<a href="#nogo" onclick="addComma('type-tag');">{%action_add_comma}</a></p>
                        </div>
                        <ul id="tag-list" class="clearfix spana"></ul>
                    </td>
                </tr>
                <tr>
                    <th><label>{%column_thumb}</label></th>
                    <td>
                        <div>
                            <input id="pk92" type="checkbox" name="isAutoThumb" value="yes" checked onclick="toggleThumb(this)"/>
                            <label for="pk92">{%auto_set_thumb}</label>
                            <input id="pk93" type="hidden" name="autoThumb"/>
                        </div>
                        <div id="div90" style="display:none;margin-top:10px;">
                            <input id="pk90" type="text" name="thumb" size="54"/>
                            <button id="btn90" type="button" class="btn" onclick="getThumbFromContent()">{%select_thumb}</button>
                        </div>
                    </td>
                </tr>
                <tr>
                    <th>{%column_meta}</th>
                    <td>
                        <div id="metas">
                            <button type="button" class="btn" onclick="addMeta()">{%action_add_meta}</button>
                            <iterate name="metaVo" id="meta">
                            <div>
                            <input type="text" class="meta-key" size="12" value="{$meta['meta']}"/><input type="text" class="meta-value" size="36" value="{$meta['value']}"/><button type="button" class="btn" onclick="deleteMeta(this)"><?php echo L('action_add_deletemeta'); ?></button>
                            </div>
                            </iterate>
                             <div>
                                <input type="text" class="meta-key" size="12" /><input type="text" class="meta-value" size="36"/><button type="button" class="btn" onclick="deleteMeta(this)">{%action_add_deletemeta}</button>
                            </div>
                        </div>
                    </td> 
                </tr>
               
            </tbody>
         </table>
         <div class="clearfix">
             <div class="panel">
                <div class="panel-title" onclick="togglePanel(this)">{%column_miscellaneous}</div>
                <div class="panel-content">
                    <table class="ips">
                        <tbody>
                           <tr>
                               <th><label for="pk_author">{%column_author}</label></th>
                               <td>
                                   <input id="pk_author" type="text" name="author" size="36" value="{$post['author']}"/>
                                   <!-- <button class="btn" type="button" onclick="select_author('pk_author')">{%action_select_author}</button> -->
                               </td>
                           </tr>
                           <tr>
                               <th><label for="pk_source">{%column_source}</label></th>
                               <td>
                                   <input id="pk_source" type="text" name="source" size="36" value="{$post['source']}"/>
                                   <!-- <button class="btn" type="button" onclick="select_author('pk_author')">{%action_select_source}</button> -->
                               </td>
                           </tr>
                           <tr>
                               <th><label for="pk_keywords">{%column_keywords}</label></th>
                               <td>
                                   <input id="pk_keywords" type="text" name="keywords" size="60" value="{$post['keywords']}"/>
                                   <p class="hint">{%column_keywords_tip}&nbsp;&nbsp;<a href="#nogo" onclick="addComma('pk_keywords');">{%action_add_comma}</a></p>
                               </td>
                           </tr>
                            <tr>
                                <th><label for="pk_desc">{%column_summary}</label></th>
                                <td>
                                    <textarea id="pk_desc" name="summary" rows="6" cols="60">{$post['summary']}</textarea>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
             </div>
         </div>
    </form>
    <ul class="fnc">
        <li><button type="button" class="btn primary" onclick="save()">{%action_publish}</button></li>
        <li><button type="button" class="btn" onclick="preview()">{%action_preview}</button></li>
    </ul>
</div>
<script type="text/javascript">
    var edit_page = true;
    var edit_categoryies = <?php echo json_encode($categoryVo);?>;
    var edit_tags = <?php echo json_encode($tagVo);?>;
</script>
<include file="pAdmin:footer" />